import api from '../api'
import settings from '~/conf/settings'

const state = {

}


const getters = {

}

const actions = {

  orderAll({commit, dispatch}, params) {
    return api.get(api.url('orderAll'), params)
  },

  orderList({commit, dispatch}, params) {
    return api.get(api.url('orderList'), params)
  },

  orderDetail({commit, dispatch}, params) {
    return api.get(api.url('orderDetail', params.id))
  },

  updateOrderOrder({commit, dispatch}, params) {
    return api.put(api.url('updateOrderOrder', params.id))
  },

  completeOrder({commit, dispatch}, params) {
    return api.put(api.url('completeOrder', params.id))
  },

  serveOrderProduct({commit, dispatch}, params) {
    return api.put(api.url('serveOrderProduct', params.id), params)
  },

  deleteOrder({commit, dispatch}, params) {
    return api.delete(api.url('deleteOrder', params.id))
  },

  returningVegetables({commit, dispatch}, params) {
    return api.delete(api.url('returningVegetables', params.id), params)
  },

  printerOrder({commit, dispatch}, params) {
    return api.post(api.url('printerOrder'), params)
  }

}

const mutations = {

}

export default {
  state,
  getters,
  actions,
  mutations
}
